﻿<Window x:Class="MVVM.WPFView.Start"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vm="clr-namespace:MVVM.ViewModel;assembly=MVVM.ViewModel"
        Title="MVVM AdventureWorks Application." 
        Height="500" Width="500"
        WindowStartupLocation="CenterScreen" WindowState="Normal"
        WindowStyle="None">
    <Window.DataContext>
        <vm:StartViewModel />
    </Window.DataContext>
    <Window.Background>
        <ImageBrush ImageSource="Images/account.jpg" />
    </Window.Background>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel 
            Grid.Row="0" Grid.ColumnSpan="4" 
            Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <TextBlock Foreground="White" FontSize="20">
                M-V-VM AdventureWorks Sample Application
                <TextBlock.Effect>
                    <DropShadowEffect Color="Black" Opacity=".8" ></DropShadowEffect>
                </TextBlock.Effect>
            </TextBlock>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Button Name="btnStart" Margin="5" IsDefault="True" Command="{Binding Path=StartCommand}">
                <Button.ToolTip>
                    <StackPanel>
                        <Label FontWeight="Bold" Background="SteelBlue" Foreground="White">
                            Start the application
                        </Label>
                        <TextBlock Padding="10" TextWrapping="WrapWithOverflow" Width="200">
                            Start the main application with the M-V-MV pattern.
                        </TextBlock>
                        <Line Stroke="SteelBlue" StrokeThickness="1" X2="200" />
                        <StackPanel Orientation="Horizontal">
                            <Image Margin="2" Source="Images/dialog-information.png"/>
                            <Label>Press F1 for more help</Label>
                        </StackPanel>
                    </StackPanel>
                </Button.ToolTip>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/home.png" Width="22" Height="22" Margin="5" />
                    <Label Margin="5" VerticalAlignment="Center">_Start</Label>
                </StackPanel>
            </Button>
            <Button Name="btnExit" Margin="5" IsCancel="True"  Command="{Binding Path=ExitCommand}">
                <Button.ToolTip>
                    <StackPanel>
                        <Label FontWeight="Bold" Background="SteelBlue" Foreground="White">
                            Exit the application
                        </Label>
                        <TextBlock Padding="10" TextWrapping="WrapWithOverflow" Width="200">
                            Exit the main application by closing all the opened threads.
                        </TextBlock>
                        <Line Stroke="SteelBlue" StrokeThickness="1" X2="200" />
                        <StackPanel Orientation="Horizontal">
                            <Image Margin="2" Source="Images/dialog-information.png"/>
                            <Label>Press F1 for more help</Label>
                        </StackPanel>
                    </StackPanel>
                </Button.ToolTip>
                <StackPanel Orientation="Horizontal">
                    <Image Source="Images/exit.png" Width="22" Height="22" Margin="5" />
                    <Label Margin="5" VerticalAlignment="Center">_Exit</Label>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</Window>
